// check-db.js
const mysql = require('mysql2/promise')

async function checkDatabase() {
  try {
    // 创建连接
    const connection = await mysql.createConnection({
      host: 'localhost',
      user: 'root',
      password: '888mei525',
      database: 'lingxi_system'
    })
    
    console.log('数据库连接成功')
    
    // 检查表
    const [tables] = await connection.execute('SHOW TABLES')
    console.log('现有表:', tables)
    
    // 关闭连接
    await connection.end()
  } catch (error) {
    console.error('数据库检查失败:', error)
  }
}

checkDatabase()